package models

import "gorm.io/gorm"

type User struct {
	gorm.Model
	Phone    string `gorm:"type:char(11);not null;commit:'手机号码'"`
	Password string `gorm:"type:char(32);not null;commit:'密码'"`
}
type AuthRealName struct {
	gorm.Model
	UserId   int    `gorm:"type:int;not null;commit:'用户Id'"`
	RealName string `gorm:"type:varchar(50);not null;commit:'真实姓名'"`
	IdCard   string `gorm:"type:varchar(18);not null;commit:'身份证'"`
}

func (a *AuthRealName) AuthList() error {
	return DB.Debug().Where("user_id=?", a.UserId).Limit(1).Find(&a).Error
}
func (a *AuthRealName) AuthCreate() error {
	return DB.Debug().Create(&a).Error
}
